package algorithm.test;

public class BuSiShenTu {

	public static void main(String[] args) {
		// TODO �Զ����ɵķ������
		// ��������
		System.out.println(shuzu(12));
		// �ݹ�����
		System.out.println(digui(12));
	}

	public static int digui(int i) {
		if (i > 2)
			return digui(i - 1) + digui(i - 2);
		else
			return 1;
	}

	public static int shuzu(int j) {
		int[] a = new int[j];
		a[0] = 1;
		a[1] = 1;
		for (int i = 2; i < a.length; i++)
			a[i] = a[i - 2] + a[i - 1];
		return a[j - 1];
	}

}
